package maping;

public class OurNode implements Comparable<OurNode> {

    int yMax;
    float xMin;
    float inv_m;

    public OurNode(int yMax, float xMin, float inv_m) {
        this.yMax = yMax;
        this.xMin = xMin;
        this.inv_m = inv_m;
    }

    public void setXMin(float d) {
        this.xMin = d;
    }

    public int getyMax() {
        return yMax;
    }

    public float getxMin() {
        return xMin;
    }

    public float getInv_m() {
        return inv_m;
    }

    @Override
    public int compareTo(OurNode o) {
        if (this.xMin < o.getxMin()) {
            return -1;
        }
        if (this.xMin > o.getxMin()) {
            return 1;
        }
        if (this.inv_m < o.getInv_m()) {
            return -1;
        }
        if (this.inv_m > o.getInv_m()) {
            return 1;
        }
        return 0;
    }

    @Override
    public OurNode clone() {
        return new OurNode(yMax, xMin, inv_m);
    }

    @Override
    public String toString() {
        return "(" + this.yMax + " , " + this.xMin + " , " + this.inv_m + ")";
    }
}
